GBML manual / Constants

SPRITE_LEAN_FORWARD

The top of the picture stays full size and the bottom shrinks away - like a sign tipped forward, with its bottom edge farther from you.

Works differently on Game Boy - The Game Boy narrows the picture on some lines by moving its two sprite pieces toward each other (the middle is covered, not squeezed), a drum or a band hides it outside the lens; 16 pixels wide at most, one picture at a time; the size is not used.

Works differently on Game Boy Color - The Game Boy Color narrows the picture on some lines by moving its two sprite pieces toward each other (the middle is covered, not squeezed), a drum or a band hides it outside the lens; 16 pixels wide at most, one picture at a time; the size is not used.

Sega Genesis: not built yet

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

SPRITE_LEAN_FORWARD: constant

Description

Names the tipped-forward shape, for draw_sprite_3d and draw_sprite_3d_scaled: the top of the picture stays full size and the bottom shrinks away, like a sign tipped forward so its bottom edge is farther from you. It is the sprite's own name for the curve TEXT_LEAN_FORWARD gives a line of text.

A real capture - a flat striped lighthouse on the left of each picture, and on the right the same lighthouse drawn with SPRITE_LEAN_FORWARD at depth 1, 2 and 3. The deeper it goes, the narrower the bottom of the curved lighthouse gets while its top stays as wide as the flat oneA real capture - a flat striped lighthouse on the left of each picture, and on the right the same lighthouse drawn with SPRITE_LEAN_FORWARD at depth 1, 2 and 3. The deeper it goes, the narrower the bottom of the curved lighthouse gets while its top stays as wide as the flat one
A real capture - a flat striped lighthouse on the left of each picture, and on the right the same lighthouse drawn with SPRITELEANFORWARD at depth 1, 2 and 3. The deeper it goes, the narrower the bottom of the curved lighthouse gets while its top stays as wide as the flat one

In each picture the flat lighthouse (plain draw_sprite) is on the left and the lean, at depth 1, 2 and then 3, is on the right. A tall striped lighthouse stands in for the example's spr_doc_tower. Real pictures from a Game Boy Advance ROM.

A real capture, 12 frames played in a loop - a plain striped lighthouse on the left stands still while the one on the right is drawn with SPRITE_LEAN_FORWARD while the depth goes 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1 and 2. At depth 3 the bottom is far narrower than the top, and at depth 0 the curved lighthouse is just the same as the flat one. The first frame, which is all a viewer that cannot animate shows, is depth 3, the page's example.A real capture, 12 frames played in a loop - a plain striped lighthouse on the left stands still while the one on the right is drawn with SPRITE_LEAN_FORWARD while the depth goes 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1 and 2. At depth 3 the bottom is far narrower than the top, and at depth 0 the curved lighthouse is just the same as the flat one. The first frame, which is all a viewer that cannot animate shows, is depth 3, the page's example.
A real capture, 12 frames played in a loop - a plain striped lighthouse on the left stands still while the one on the right is drawn with SPRITELEANFORWARD while the depth goes 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1 and 2. At depth 3 the bottom is far narrower than the top, and at depth 0 the curved lighthouse is just the same as the flat one. The first frame, which is all a viewer that cannot animate shows, is depth 3, the page's example.

The same call with only depth changing (the line under the picture says which depth): twelve real pictures played in a loop, each held for about a third of a second. The plain lighthouse on the left is draw_sprite and never changes. A viewer that does not animate shows the first frame, depth 3.

A sprite's lean goes from depth 1 (gentle) to depth 3 (deep): the bottom is drawn at about 80%, 67% and 57% of its width. A bigger number is treated as 3. Read draw_sprite_3d for why a sprite stops at 3, and what the call costs.

Example

draw_sprite_3d(spr_doc_tower, x, y, 0, SPRITE_LEAN_FORWARD, 3);

The tower with its bottom edge tipped away from you, like a sign leaning forward.

See also: draw_sprite_3ddraw_sprite_3d_scaledTEXT_LEAN_FORWARDSPRITE_BULGESPRITE_LEAN_BACKSPRITE_DRUM